package com.qinggeng.project.system.service.impl;

import com.qinggeng.project.api.dto.UserBindDto;
import com.qinggeng.project.system.domain.UserBind;
import com.qinggeng.project.system.mapper.UserBindMapper;
import com.qinggeng.project.system.service.UserBindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吴鹏飞
 * @date 2020/10/20
 */
@Service
public class UserBindServiceImpl implements UserBindService {
    @Autowired
    private UserBindMapper userBindMapper;

    @Override
    public List<UserBindDto> selectUserBindInfoByUserId(Long userId) {
        return userBindMapper.selectUserBindInfoByUserId(userId);
    }

    @Override
    public int untieById(Long id) {
        return userBindMapper.updateIsbindById(id);
    }

    @Override
    public UserBind selectUserBindByUserIdAndPlatform(Long userId, String platform) {
        return userBindMapper.selectUserBindByUserIdAndPlatform(userId,platform);
    }
}
